home *** CD-ROM | disk | FTP | other *** search
- (* Conspiracy BBS Software Version 0.01α (c)1995 Grooven Designs *)
- (* Conspiracy Configuration Program *)
- (* Coded by Paul Maggs / Grooven Designs *)
-
- (* Conspiracy v0.01α Configuration Unit (will be) *)
- unit configur;
-
- interface
-
- procedure init_config_file;
- procedure init_ansi_file;
- procedure set_options;
- procedure insert_config;
- procedure menu;
- procedure run_config;
-
- implementation
-
- uses crt,
- ansi;
-
- {$R+}
-
- type
- GroovyConfig = Record
- BoardName : String[30];
- SysopName : String[30];
- BbsPhone : String[15];
- Rego : String[12];
- BbsDir : String[30];
- DataDir : String[30];
- TxtDir : String[30];
- { MsgDir : String[30];}
- end;
-
-
- var
- configfile : file of GroovyConfig;
- config : GroovyConfig;
- i : byte;
- options : array[1..9] of string[30];
- choice : char;
- option : byte;
- grid_ref : byte;
- cows_come_home : boolean;
-
-
- procedure init_config_file;
- begin
- assign(configfile,'data\config.dat');
- reset(configfile);
- end;
-
-
- procedure init_ansi_file;
- begin
- clrscr;
- write_picture('configa');
- end;
-
- procedure set_options;
- begin
- options[1]:=' Bulletin Board Name ';
- options[2]:=' System Operator ';
- options[3]:=' BBS Phone Number ';
- options[4]:=' Registration Code ';
- options[5]:=' Main Directory ';
- options[6]:=' Data Directory ';
- options[7]:=' Text File Directory ';
- { options[8]:=' Message Directory ';}
- { for i := 1 to 8 do
- writeln(options[i]);}
- end;
-
- procedure exit;
- begin
- textcolor(3);
- textbackground(0);
- filemode:=2;
- rewrite(Configfile);
- write(configfile,config);
- close(configfile);
- clrscr;
- writeln(' Conspiracy Configuration Program v0.01α (c) 1995 Grooven Designs');
- halt
- end;
-
-
- procedure insert_config;
- begin
- read(configfile,config);
- textcolor(3);
- gotoxy(32,9);
- write(config.boardname);
- gotoxy(32,10);
- write(config.sysopname);
- gotoxy(32,11);
- write(config.bbsphone);
- gotoxy(32,12);
- write(config.rego);
- gotoxy(32,13);
- write(config.bbsdir);
- gotoxy(32,14);
- write(config.datadir);
- gotoxy(32,15);
- write(config.txtdir);
- end;
-
- procedure menu;
- begin
- gotoxy(9,9);
- textcolor(0);
- textbackground(3);
- write(options[1]);
- option:=1;
- grid_ref:=9;
- repeat;
- choice:=readkey;
- case choice of
- #13 : if option=1 then begin
- textcolor(3);
- textbackground(0);
- gotoxy(32,9);
- Readln(config.boardname);
- end else
- if option=2 then begin
- textcolor(3);
- textbackground(0);
- gotoxy(32,10);
- Readln(config.sysopname);
- end else
- if option=3 then begin
- textcolor(3);
- textbackground(0);
- gotoxy(32,11);
- readln(config.bbsphone);
- end else
- if option=4 then begin
- textcolor(3);
- textbackground(0);
- gotoxy(32,12);
- readln(config.rego);
- end else
- if option=5 then begin
- textcolor(3);
- textbackground(0);
- gotoxy(32,13);
- readln(config.bbsdir);
- end else
- if option=6 then begin
- textcolor(3);
- textbackground(0);
- gotoxy(32,14);
- readln(config.datadir);
- end else
- if option=7 then begin
- textcolor(3);
- textbackground(0);
- gotoxy(32,15);
- readln(config.txtdir);
- end;
-
-
- #27 : exit;
- #80 : begin
- if option<7 then begin {To enable it to loop}
- gotoxy(9,grid_ref);
- textbackground(0);
- textcolor(7);
- write(options[option]);
- inc(grid_ref);
- gotoxy(9,grid_ref);
- textbackground(3);
- textcolor(0);
- {i:=i-1;}
- writeln(options[option+1]);
- option:=option+1;
- end else begin
- gotoxy(9,grid_ref);
- textcolor(7);
- textbackground(0);
- write(options[7]); {set to last option at the mo}
- grid_ref:=grid_ref-6;
- gotoxy(9,grid_ref);
- textcolor(0);
- textbackground(3);
- write(options[1]);
- option:=option-6;
- end
- end;
-
- #72 : begin
- if option>1 then begin
- gotoxy(9,grid_ref);
- textbackground(0);
- textcolor(7);
- write(options[option]);
- inc(grid_ref);
- gotoxy(9,grid_ref-2);
- textbackground(3);
- textcolor(0);
- {i:=i;}
- writeln(options[option-1]);
- option:=option-1;
- grid_ref:=grid_ref-2;
- end else begin
- gotoxy(9,grid_ref);
- textcolor(7);
- textbackground(0);
- write(options[1]); {set to first option at the mo}
- grid_ref:=grid_ref+6;
- gotoxy(9,grid_ref);
- textcolor(0);
- textbackground(3);
- write(options[7]);
- option:=option+6;
- end;
-
- end;
-
-
- end;
- cows_come_home:=false;
- until cows_come_home;
-
-
- end;
-
- (* ------------------------------------------------------------------------ *)
-
- procedure run_config;
- begin
- init_config_file;
- init_ansi_file;
- set_options;
- insert_config;
- menu;
- end;
- end.